
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module gdata.tlslite.integration.SMTP_TLS</title>
</head><body bgcolor="#f0f0f8">

<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="gdata.html"><font color="#ffffff">gdata</font></a>.<a href="gdata.tlslite.html"><font color="#ffffff">tlslite</font></a>.<a href="gdata.tlslite.integration.html"><font color="#ffffff">integration</font></a>.SMTP_TLS</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/usr/local/google/home/afshar/src/external-gdata-release/google3/src/gdata/tlslite/integration/SMTP_TLS.py">/usr/local/google/home/afshar/src/external-gdata-release/google3/src/gdata/tlslite/integration/SMTP_TLS.py</a></font></td></tr></table>
    <p><tt>TLS&nbsp;Lite&nbsp;+&nbsp;smtplib.</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
    
<tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="smtplib.html#SMTP">smtplib.SMTP</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="gdata.tlslite.integration.SMTP_TLS.html#SMTP_TLS">SMTP_TLS</a>
</font></dt></dl>
</dd>
</dl>
 <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="SMTP_TLS">class <strong>SMTP_TLS</strong></a>(<a href="smtplib.html#SMTP">smtplib.SMTP</a>)</font></td></tr>
    
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>This&nbsp;class&nbsp;extends&nbsp;L{smtplib.<a href="smtplib.html#SMTP">SMTP</a>}&nbsp;with&nbsp;TLS&nbsp;support.<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="SMTP_TLS-starttls"><strong>starttls</strong></a>(self, username<font color="#909090">=None</font>, password<font color="#909090">=None</font>, sharedKey<font color="#909090">=None</font>, certChain<font color="#909090">=None</font>, privateKey<font color="#909090">=None</font>, cryptoID<font color="#909090">=None</font>, protocol<font color="#909090">=None</font>, x509Fingerprint<font color="#909090">=None</font>, x509TrustList<font color="#909090">=None</font>, x509CommonName<font color="#909090">=None</font>, settings<font color="#909090">=None</font>)</dt><dd><tt>Puts&nbsp;the&nbsp;connection&nbsp;to&nbsp;the&nbsp;<a href="smtplib.html#SMTP">SMTP</a>&nbsp;server&nbsp;into&nbsp;TLS&nbsp;mode.<br>
&nbsp;<br>
If&nbsp;the&nbsp;server&nbsp;supports&nbsp;TLS,&nbsp;this&nbsp;will&nbsp;encrypt&nbsp;the&nbsp;rest&nbsp;of&nbsp;the&nbsp;<a href="smtplib.html#SMTP">SMTP</a><br>
session.<br>
&nbsp;<br>
For&nbsp;client&nbsp;authentication,&nbsp;use&nbsp;one&nbsp;of&nbsp;these&nbsp;argument<br>
combinations:<br>
&nbsp;-&nbsp;username,&nbsp;password&nbsp;(SRP)<br>
&nbsp;-&nbsp;username,&nbsp;sharedKey&nbsp;(shared-key)<br>
&nbsp;-&nbsp;certChain,&nbsp;privateKey&nbsp;(certificate)<br>
&nbsp;<br>
For&nbsp;server&nbsp;authentication,&nbsp;you&nbsp;can&nbsp;either&nbsp;rely&nbsp;on&nbsp;the<br>
implicit&nbsp;mutual&nbsp;authentication&nbsp;performed&nbsp;by&nbsp;SRP&nbsp;or<br>
shared-keys,&nbsp;or&nbsp;you&nbsp;can&nbsp;do&nbsp;certificate-based&nbsp;server<br>
authentication&nbsp;with&nbsp;one&nbsp;of&nbsp;these&nbsp;argument&nbsp;combinations:<br>
&nbsp;-&nbsp;cryptoID[,&nbsp;protocol]&nbsp;(requires&nbsp;cryptoIDlib)<br>
&nbsp;-&nbsp;x509Fingerprint<br>
&nbsp;-&nbsp;x509TrustList[,&nbsp;x509CommonName]&nbsp;(requires&nbsp;cryptlib_py)<br>
&nbsp;<br>
Certificate-based&nbsp;server&nbsp;authentication&nbsp;is&nbsp;compatible&nbsp;with<br>
SRP&nbsp;or&nbsp;certificate-based&nbsp;client&nbsp;authentication.&nbsp;&nbsp;It&nbsp;is<br>
not&nbsp;compatible&nbsp;with&nbsp;shared-keys.<br>
&nbsp;<br>
The&nbsp;caller&nbsp;should&nbsp;be&nbsp;prepared&nbsp;to&nbsp;handle&nbsp;TLS-specific<br>
exceptions.&nbsp;&nbsp;See&nbsp;the&nbsp;client&nbsp;handshake&nbsp;functions&nbsp;in<br>
L{tlslite.TLSConnection.TLSConnection}&nbsp;for&nbsp;details&nbsp;on&nbsp;which<br>
exceptions&nbsp;might&nbsp;be&nbsp;raised.<br>
&nbsp;<br>
@type&nbsp;username:&nbsp;str<br>
@param&nbsp;username:&nbsp;SRP&nbsp;or&nbsp;shared-key&nbsp;username.&nbsp;&nbsp;Requires&nbsp;the<br>
'password'&nbsp;or&nbsp;'sharedKey'&nbsp;argument.<br>
&nbsp;<br>
@type&nbsp;password:&nbsp;str<br>
@param&nbsp;password:&nbsp;SRP&nbsp;password&nbsp;for&nbsp;mutual&nbsp;authentication.<br>
Requires&nbsp;the&nbsp;'username'&nbsp;argument.<br>
&nbsp;<br>
@type&nbsp;sharedKey:&nbsp;str<br>
@param&nbsp;sharedKey:&nbsp;Shared&nbsp;key&nbsp;for&nbsp;mutual&nbsp;authentication.<br>
Requires&nbsp;the&nbsp;'username'&nbsp;argument.<br>
&nbsp;<br>
@type&nbsp;certChain:&nbsp;L{tlslite.X509CertChain.X509CertChain}&nbsp;or<br>
L{cryptoIDlib.CertChain.CertChain}<br>
@param&nbsp;certChain:&nbsp;Certificate&nbsp;chain&nbsp;for&nbsp;client&nbsp;authentication.<br>
Requires&nbsp;the&nbsp;'privateKey'&nbsp;argument.&nbsp;&nbsp;Excludes&nbsp;the&nbsp;SRP&nbsp;or<br>
shared-key&nbsp;related&nbsp;arguments.<br>
&nbsp;<br>
@type&nbsp;privateKey:&nbsp;L{tlslite.utils.RSAKey.RSAKey}<br>
@param&nbsp;privateKey:&nbsp;Private&nbsp;key&nbsp;for&nbsp;client&nbsp;authentication.<br>
Requires&nbsp;the&nbsp;'certChain'&nbsp;argument.&nbsp;&nbsp;Excludes&nbsp;the&nbsp;SRP&nbsp;or<br>
shared-key&nbsp;related&nbsp;arguments.<br>
&nbsp;<br>
@type&nbsp;cryptoID:&nbsp;str<br>
@param&nbsp;cryptoID:&nbsp;cryptoID&nbsp;for&nbsp;server&nbsp;authentication.&nbsp;&nbsp;Mutually<br>
exclusive&nbsp;with&nbsp;the&nbsp;'x509...'&nbsp;arguments.<br>
&nbsp;<br>
@type&nbsp;protocol:&nbsp;str<br>
@param&nbsp;protocol:&nbsp;cryptoID&nbsp;protocol&nbsp;URI&nbsp;for&nbsp;server<br>
authentication.&nbsp;&nbsp;Requires&nbsp;the&nbsp;'cryptoID'&nbsp;argument.<br>
&nbsp;<br>
@type&nbsp;x509Fingerprint:&nbsp;str<br>
@param&nbsp;x509Fingerprint:&nbsp;Hex-encoded&nbsp;X.509&nbsp;fingerprint&nbsp;for<br>
server&nbsp;authentication.&nbsp;&nbsp;Mutually&nbsp;exclusive&nbsp;with&nbsp;the&nbsp;'cryptoID'<br>
and&nbsp;'x509TrustList'&nbsp;arguments.<br>
&nbsp;<br>
@type&nbsp;x509TrustList:&nbsp;list&nbsp;of&nbsp;L{tlslite.X509.X509}<br>
@param&nbsp;x509TrustList:&nbsp;A&nbsp;list&nbsp;of&nbsp;trusted&nbsp;root&nbsp;certificates.&nbsp;&nbsp;The<br>
other&nbsp;party&nbsp;must&nbsp;present&nbsp;a&nbsp;certificate&nbsp;chain&nbsp;which&nbsp;extends&nbsp;to<br>
one&nbsp;of&nbsp;these&nbsp;root&nbsp;certificates.&nbsp;&nbsp;The&nbsp;cryptlib_py&nbsp;module&nbsp;must&nbsp;be<br>
installed&nbsp;to&nbsp;use&nbsp;this&nbsp;parameter.&nbsp;&nbsp;Mutually&nbsp;exclusive&nbsp;with&nbsp;the<br>
'cryptoID'&nbsp;and&nbsp;'x509Fingerprint'&nbsp;arguments.<br>
&nbsp;<br>
@type&nbsp;x509CommonName:&nbsp;str<br>
@param&nbsp;x509CommonName:&nbsp;The&nbsp;end-entity&nbsp;certificate's&nbsp;'CN'&nbsp;field<br>
must&nbsp;match&nbsp;this&nbsp;value.&nbsp;&nbsp;For&nbsp;a&nbsp;web&nbsp;server,&nbsp;this&nbsp;is&nbsp;typically&nbsp;a<br>
server&nbsp;name&nbsp;such&nbsp;as&nbsp;'www.amazon.com'.&nbsp;&nbsp;Mutually&nbsp;exclusive&nbsp;with<br>
the&nbsp;'cryptoID'&nbsp;and&nbsp;'x509Fingerprint'&nbsp;arguments.&nbsp;&nbsp;Requires&nbsp;the<br>
'x509TrustList'&nbsp;argument.<br>
&nbsp;<br>
@type&nbsp;settings:&nbsp;L{tlslite.HandshakeSettings.HandshakeSettings}<br>
@param&nbsp;settings:&nbsp;Various&nbsp;settings&nbsp;which&nbsp;can&nbsp;be&nbsp;used&nbsp;to&nbsp;control<br>
the&nbsp;ciphersuites,&nbsp;certificate&nbsp;types,&nbsp;and&nbsp;SSL/TLS&nbsp;versions<br>
offered&nbsp;by&nbsp;the&nbsp;client.</tt></dd></dl>

<hr>
Methods inherited from <a href="smtplib.html#SMTP">smtplib.SMTP</a>:<br>
<dl><dt><a name="SMTP_TLS-__init__"><strong>__init__</strong></a>(self, host<font color="#909090">=''</font>, port<font color="#909090">=0</font>, local_hostname<font color="#909090">=None</font>, timeout<font color="#909090">=&lt;object object&gt;</font>)</dt><dd><tt>Initialize&nbsp;a&nbsp;new&nbsp;instance.<br>
&nbsp;<br>
If&nbsp;specified,&nbsp;`host'&nbsp;is&nbsp;the&nbsp;name&nbsp;of&nbsp;the&nbsp;remote&nbsp;host&nbsp;to&nbsp;which&nbsp;to<br>
connect.&nbsp;&nbsp;If&nbsp;specified,&nbsp;`port'&nbsp;specifies&nbsp;the&nbsp;port&nbsp;to&nbsp;which&nbsp;to&nbsp;connect.<br>
By&nbsp;default,&nbsp;smtplib.SMTP_PORT&nbsp;is&nbsp;used.&nbsp;&nbsp;An&nbsp;SMTPConnectError&nbsp;is&nbsp;raised<br>
if&nbsp;the&nbsp;specified&nbsp;`host'&nbsp;doesn't&nbsp;respond&nbsp;correctly.&nbsp;&nbsp;If&nbsp;specified,<br>
`local_hostname`&nbsp;is&nbsp;used&nbsp;as&nbsp;the&nbsp;FQDN&nbsp;of&nbsp;the&nbsp;local&nbsp;host.&nbsp;&nbsp;By&nbsp;default,<br>
the&nbsp;local&nbsp;hostname&nbsp;is&nbsp;found&nbsp;using&nbsp;socket.getfqdn().</tt></dd></dl>

<dl><dt><a name="SMTP_TLS-close"><strong>close</strong></a>(self)</dt><dd><tt>Close&nbsp;the&nbsp;connection&nbsp;to&nbsp;the&nbsp;<a href="smtplib.html#SMTP">SMTP</a>&nbsp;server.</tt></dd></dl>

<dl><dt><a name="SMTP_TLS-connect"><strong>connect</strong></a>(self, host<font color="#909090">='localhost'</font>, port<font color="#909090">=0</font>)</dt><dd><tt>Connect&nbsp;to&nbsp;a&nbsp;host&nbsp;on&nbsp;a&nbsp;given&nbsp;port.<br>
&nbsp;<br>
If&nbsp;the&nbsp;hostname&nbsp;ends&nbsp;with&nbsp;a&nbsp;colon&nbsp;(`:')&nbsp;followed&nbsp;by&nbsp;a&nbsp;number,&nbsp;and<br>
there&nbsp;is&nbsp;no&nbsp;port&nbsp;specified,&nbsp;that&nbsp;suffix&nbsp;will&nbsp;be&nbsp;stripped&nbsp;off&nbsp;and&nbsp;the<br>
number&nbsp;interpreted&nbsp;as&nbsp;the&nbsp;port&nbsp;number&nbsp;to&nbsp;use.<br>
&nbsp;<br>
Note:&nbsp;This&nbsp;method&nbsp;is&nbsp;automatically&nbsp;invoked&nbsp;by&nbsp;__init__,&nbsp;if&nbsp;a&nbsp;host&nbsp;is<br>
specified&nbsp;during&nbsp;instantiation.</tt></dd></dl>

<dl><dt><a name="SMTP_TLS-data"><strong>data</strong></a>(self, msg)</dt><dd><tt><a href="smtplib.html#SMTP">SMTP</a>&nbsp;'DATA'&nbsp;command&nbsp;--&nbsp;sends&nbsp;message&nbsp;data&nbsp;to&nbsp;server.<br>
&nbsp;<br>
Automatically&nbsp;quotes&nbsp;lines&nbsp;beginning&nbsp;with&nbsp;a&nbsp;period&nbsp;per&nbsp;rfc821.<br>
Raises&nbsp;SMTPDataError&nbsp;if&nbsp;there&nbsp;is&nbsp;an&nbsp;unexpected&nbsp;reply&nbsp;to&nbsp;the<br>
DATA&nbsp;command;&nbsp;the&nbsp;return&nbsp;value&nbsp;from&nbsp;this&nbsp;method&nbsp;is&nbsp;the&nbsp;final<br>
response&nbsp;code&nbsp;received&nbsp;when&nbsp;the&nbsp;all&nbsp;data&nbsp;is&nbsp;sent.</tt></dd></dl>

<dl><dt><a name="SMTP_TLS-docmd"><strong>docmd</strong></a>(self, cmd, args<font color="#909090">=''</font>)</dt><dd><tt>Send&nbsp;a&nbsp;command,&nbsp;and&nbsp;return&nbsp;its&nbsp;response&nbsp;code.</tt></dd></dl>

<dl><dt><a name="SMTP_TLS-ehlo"><strong>ehlo</strong></a>(self, name<font color="#909090">=''</font>)</dt><dd><tt><a href="smtplib.html#SMTP">SMTP</a>&nbsp;'ehlo'&nbsp;command.<br>
Hostname&nbsp;to&nbsp;send&nbsp;for&nbsp;this&nbsp;command&nbsp;defaults&nbsp;to&nbsp;the&nbsp;FQDN&nbsp;of&nbsp;the&nbsp;local<br>
host.</tt></dd></dl>

<dl><dt><a name="SMTP_TLS-ehlo_or_helo_if_needed"><strong>ehlo_or_helo_if_needed</strong></a>(self)</dt><dd><tt>Call&nbsp;<a href="#SMTP_TLS-ehlo_msg">ehlo</a>()&nbsp;and/or&nbsp;<a href="#SMTP_TLS-helo">helo</a>()&nbsp;if&nbsp;needed.<br>
&nbsp;<br>
If&nbsp;there&nbsp;has&nbsp;been&nbsp;no&nbsp;previous&nbsp;EHLO&nbsp;or&nbsp;HELO&nbsp;command&nbsp;this&nbsp;session,&nbsp;this<br>
method&nbsp;tries&nbsp;ESMTP&nbsp;EHLO&nbsp;first.<br>
&nbsp;<br>
This&nbsp;method&nbsp;may&nbsp;raise&nbsp;the&nbsp;following&nbsp;exceptions:<br>
&nbsp;<br>
&nbsp;SMTPHeloError&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;server&nbsp;didn't&nbsp;reply&nbsp;properly&nbsp;to<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;helo&nbsp;greeting.</tt></dd></dl>

<dl><dt><a name="SMTP_TLS-expn"><strong>expn</strong></a>(self, address)</dt><dd><tt><a href="smtplib.html#SMTP">SMTP</a>&nbsp;'expn'&nbsp;command&nbsp;--&nbsp;expands&nbsp;a&nbsp;mailing&nbsp;list.</tt></dd></dl>

<dl><dt><a name="SMTP_TLS-getreply"><strong>getreply</strong></a>(self)</dt><dd><tt>Get&nbsp;a&nbsp;reply&nbsp;from&nbsp;the&nbsp;server.<br>
&nbsp;<br>
Returns&nbsp;a&nbsp;tuple&nbsp;consisting&nbsp;of:<br>
&nbsp;<br>
&nbsp;&nbsp;-&nbsp;server&nbsp;response&nbsp;code&nbsp;(e.g.&nbsp;'250',&nbsp;or&nbsp;such,&nbsp;if&nbsp;all&nbsp;goes&nbsp;well)<br>
&nbsp;&nbsp;&nbsp;&nbsp;Note:&nbsp;returns&nbsp;-1&nbsp;if&nbsp;it&nbsp;can't&nbsp;read&nbsp;response&nbsp;code.<br>
&nbsp;<br>
&nbsp;&nbsp;-&nbsp;server&nbsp;response&nbsp;string&nbsp;corresponding&nbsp;to&nbsp;response&nbsp;code&nbsp;(multiline<br>
&nbsp;&nbsp;&nbsp;&nbsp;responses&nbsp;are&nbsp;converted&nbsp;to&nbsp;a&nbsp;single,&nbsp;multiline&nbsp;string).<br>
&nbsp;<br>
Raises&nbsp;SMTPServerDisconnected&nbsp;if&nbsp;end-of-file&nbsp;is&nbsp;reached.</tt></dd></dl>

<dl><dt><a name="SMTP_TLS-has_extn"><strong>has_extn</strong></a>(self, opt)</dt><dd><tt>Does&nbsp;the&nbsp;server&nbsp;support&nbsp;a&nbsp;given&nbsp;<a href="smtplib.html#SMTP">SMTP</a>&nbsp;service&nbsp;extension?</tt></dd></dl>

<dl><dt><a name="SMTP_TLS-helo"><strong>helo</strong></a>(self, name<font color="#909090">=''</font>)</dt><dd><tt><a href="smtplib.html#SMTP">SMTP</a>&nbsp;'helo'&nbsp;command.<br>
Hostname&nbsp;to&nbsp;send&nbsp;for&nbsp;this&nbsp;command&nbsp;defaults&nbsp;to&nbsp;the&nbsp;FQDN&nbsp;of&nbsp;the&nbsp;local<br>
host.</tt></dd></dl>

<dl><dt><a name="SMTP_TLS-help"><strong>help</strong></a>(self, args<font color="#909090">=''</font>)</dt><dd><tt><a href="smtplib.html#SMTP">SMTP</a>&nbsp;'help'&nbsp;command.<br>
Returns&nbsp;help&nbsp;text&nbsp;from&nbsp;server.</tt></dd></dl>

<dl><dt><a name="SMTP_TLS-login"><strong>login</strong></a>(self, user, password)</dt><dd><tt>Log&nbsp;in&nbsp;on&nbsp;an&nbsp;<a href="smtplib.html#SMTP">SMTP</a>&nbsp;server&nbsp;that&nbsp;requires&nbsp;authentication.<br>
&nbsp;<br>
The&nbsp;arguments&nbsp;are:<br>
&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;user:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;user&nbsp;name&nbsp;to&nbsp;authenticate&nbsp;with.<br>
&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;password:&nbsp;The&nbsp;password&nbsp;for&nbsp;the&nbsp;authentication.<br>
&nbsp;<br>
If&nbsp;there&nbsp;has&nbsp;been&nbsp;no&nbsp;previous&nbsp;EHLO&nbsp;or&nbsp;HELO&nbsp;command&nbsp;this&nbsp;session,&nbsp;this<br>
method&nbsp;tries&nbsp;ESMTP&nbsp;EHLO&nbsp;first.<br>
&nbsp;<br>
This&nbsp;method&nbsp;will&nbsp;return&nbsp;normally&nbsp;if&nbsp;the&nbsp;authentication&nbsp;was&nbsp;successful.<br>
&nbsp;<br>
This&nbsp;method&nbsp;may&nbsp;raise&nbsp;the&nbsp;following&nbsp;exceptions:<br>
&nbsp;<br>
&nbsp;SMTPHeloError&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;server&nbsp;didn't&nbsp;reply&nbsp;properly&nbsp;to<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;helo&nbsp;greeting.<br>
&nbsp;SMTPAuthenticationError&nbsp;&nbsp;The&nbsp;server&nbsp;didn't&nbsp;accept&nbsp;the&nbsp;username/<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;password&nbsp;combination.<br>
&nbsp;SMTPException&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;No&nbsp;suitable&nbsp;authentication&nbsp;method&nbsp;was<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;found.</tt></dd></dl>

<dl><dt><a name="SMTP_TLS-mail"><strong>mail</strong></a>(self, sender, options<font color="#909090">=[]</font>)</dt><dd><tt><a href="smtplib.html#SMTP">SMTP</a>&nbsp;'mail'&nbsp;command&nbsp;--&nbsp;begins&nbsp;mail&nbsp;xfer&nbsp;session.</tt></dd></dl>

<dl><dt><a name="SMTP_TLS-noop"><strong>noop</strong></a>(self)</dt><dd><tt><a href="smtplib.html#SMTP">SMTP</a>&nbsp;'noop'&nbsp;command&nbsp;--&nbsp;doesn't&nbsp;do&nbsp;anything&nbsp;:&gt;</tt></dd></dl>

<dl><dt><a name="SMTP_TLS-putcmd"><strong>putcmd</strong></a>(self, cmd, args<font color="#909090">=''</font>)</dt><dd><tt>Send&nbsp;a&nbsp;command&nbsp;to&nbsp;the&nbsp;server.</tt></dd></dl>

<dl><dt><a name="SMTP_TLS-quit"><strong>quit</strong></a>(self)</dt><dd><tt>Terminate&nbsp;the&nbsp;<a href="smtplib.html#SMTP">SMTP</a>&nbsp;session.</tt></dd></dl>

<dl><dt><a name="SMTP_TLS-rcpt"><strong>rcpt</strong></a>(self, recip, options<font color="#909090">=[]</font>)</dt><dd><tt><a href="smtplib.html#SMTP">SMTP</a>&nbsp;'rcpt'&nbsp;command&nbsp;--&nbsp;indicates&nbsp;1&nbsp;recipient&nbsp;for&nbsp;this&nbsp;mail.</tt></dd></dl>

<dl><dt><a name="SMTP_TLS-rset"><strong>rset</strong></a>(self)</dt><dd><tt><a href="smtplib.html#SMTP">SMTP</a>&nbsp;'rset'&nbsp;command&nbsp;--&nbsp;resets&nbsp;session.</tt></dd></dl>

<dl><dt><a name="SMTP_TLS-send"><strong>send</strong></a>(self, str)</dt><dd><tt>Send&nbsp;`str'&nbsp;to&nbsp;the&nbsp;server.</tt></dd></dl>

<dl><dt><a name="SMTP_TLS-sendmail"><strong>sendmail</strong></a>(self, from_addr, to_addrs, msg, mail_options<font color="#909090">=[]</font>, rcpt_options<font color="#909090">=[]</font>)</dt><dd><tt>This&nbsp;command&nbsp;performs&nbsp;an&nbsp;entire&nbsp;mail&nbsp;transaction.<br>
&nbsp;<br>
The&nbsp;arguments&nbsp;are:<br>
&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;from_addr&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;The&nbsp;address&nbsp;sending&nbsp;this&nbsp;mail.<br>
&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;to_addrs&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;A&nbsp;list&nbsp;of&nbsp;addresses&nbsp;to&nbsp;send&nbsp;this&nbsp;mail&nbsp;to.&nbsp;&nbsp;A&nbsp;bare<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;string&nbsp;will&nbsp;be&nbsp;treated&nbsp;as&nbsp;a&nbsp;list&nbsp;with&nbsp;1&nbsp;address.<br>
&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;msg&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;The&nbsp;message&nbsp;to&nbsp;send.<br>
&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;mail_options&nbsp;:&nbsp;List&nbsp;of&nbsp;ESMTP&nbsp;options&nbsp;(such&nbsp;as&nbsp;8bitmime)&nbsp;for&nbsp;the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mail&nbsp;command.<br>
&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;rcpt_options&nbsp;:&nbsp;List&nbsp;of&nbsp;ESMTP&nbsp;options&nbsp;(such&nbsp;as&nbsp;DSN&nbsp;commands)&nbsp;for<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;all&nbsp;the&nbsp;rcpt&nbsp;commands.<br>
&nbsp;<br>
If&nbsp;there&nbsp;has&nbsp;been&nbsp;no&nbsp;previous&nbsp;EHLO&nbsp;or&nbsp;HELO&nbsp;command&nbsp;this&nbsp;session,&nbsp;this<br>
method&nbsp;tries&nbsp;ESMTP&nbsp;EHLO&nbsp;first.&nbsp;&nbsp;If&nbsp;the&nbsp;server&nbsp;does&nbsp;ESMTP,&nbsp;message&nbsp;size<br>
and&nbsp;each&nbsp;of&nbsp;the&nbsp;specified&nbsp;options&nbsp;will&nbsp;be&nbsp;passed&nbsp;to&nbsp;it.&nbsp;&nbsp;If&nbsp;EHLO<br>
fails,&nbsp;HELO&nbsp;will&nbsp;be&nbsp;tried&nbsp;and&nbsp;ESMTP&nbsp;options&nbsp;suppressed.<br>
&nbsp;<br>
This&nbsp;method&nbsp;will&nbsp;return&nbsp;normally&nbsp;if&nbsp;the&nbsp;mail&nbsp;is&nbsp;accepted&nbsp;for&nbsp;at&nbsp;least<br>
one&nbsp;recipient.&nbsp;&nbsp;It&nbsp;returns&nbsp;a&nbsp;dictionary,&nbsp;with&nbsp;one&nbsp;entry&nbsp;for&nbsp;each<br>
recipient&nbsp;that&nbsp;was&nbsp;refused.&nbsp;&nbsp;Each&nbsp;entry&nbsp;contains&nbsp;a&nbsp;tuple&nbsp;of&nbsp;the&nbsp;<a href="smtplib.html#SMTP">SMTP</a><br>
error&nbsp;code&nbsp;and&nbsp;the&nbsp;accompanying&nbsp;error&nbsp;message&nbsp;sent&nbsp;by&nbsp;the&nbsp;server.<br>
&nbsp;<br>
This&nbsp;method&nbsp;may&nbsp;raise&nbsp;the&nbsp;following&nbsp;exceptions:<br>
&nbsp;<br>
&nbsp;SMTPHeloError&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;server&nbsp;didn't&nbsp;reply&nbsp;properly&nbsp;to<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;helo&nbsp;greeting.<br>
&nbsp;SMTPRecipientsRefused&nbsp;&nbsp;The&nbsp;server&nbsp;rejected&nbsp;ALL&nbsp;recipients<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(no&nbsp;mail&nbsp;was&nbsp;sent).<br>
&nbsp;SMTPSenderRefused&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;server&nbsp;didn't&nbsp;accept&nbsp;the&nbsp;from_addr.<br>
&nbsp;SMTPDataError&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;server&nbsp;replied&nbsp;with&nbsp;an&nbsp;unexpected<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;error&nbsp;code&nbsp;(other&nbsp;than&nbsp;a&nbsp;refusal&nbsp;of<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a&nbsp;recipient).<br>
&nbsp;<br>
Note:&nbsp;the&nbsp;connection&nbsp;will&nbsp;be&nbsp;open&nbsp;even&nbsp;after&nbsp;an&nbsp;exception&nbsp;is&nbsp;raised.<br>
&nbsp;<br>
Example:<br>
&nbsp;<br>
&nbsp;&gt;&gt;&gt;&nbsp;import&nbsp;smtplib<br>
&nbsp;&gt;&gt;&gt;&nbsp;s=smtplib.<a href="smtplib.html#SMTP">SMTP</a>("localhost")<br>
&nbsp;&gt;&gt;&gt;&nbsp;tolist=["one@one.org","two@two.org","three@three.org","four@four.org"]<br>
&nbsp;&gt;&gt;&gt;&nbsp;msg&nbsp;=&nbsp;'''\<br>
&nbsp;...&nbsp;From:&nbsp;Me@my.org<br>
&nbsp;...&nbsp;Subject:&nbsp;testin'...<br>
&nbsp;...<br>
&nbsp;...&nbsp;This&nbsp;is&nbsp;a&nbsp;test&nbsp;'''<br>
&nbsp;&gt;&gt;&gt;&nbsp;s.<a href="#SMTP_TLS-sendmail">sendmail</a>("me@my.org",tolist,msg)<br>
&nbsp;{&nbsp;"three@three.org"&nbsp;:&nbsp;(&nbsp;550&nbsp;,"User&nbsp;unknown"&nbsp;)&nbsp;}<br>
&nbsp;&gt;&gt;&gt;&nbsp;s.<a href="#SMTP_TLS-quit">quit</a>()<br>
&nbsp;<br>
In&nbsp;the&nbsp;above&nbsp;example,&nbsp;the&nbsp;message&nbsp;was&nbsp;accepted&nbsp;for&nbsp;delivery&nbsp;to&nbsp;three<br>
of&nbsp;the&nbsp;four&nbsp;addresses,&nbsp;and&nbsp;one&nbsp;was&nbsp;rejected,&nbsp;with&nbsp;the&nbsp;error&nbsp;code<br>
550.&nbsp;&nbsp;If&nbsp;all&nbsp;addresses&nbsp;are&nbsp;accepted,&nbsp;then&nbsp;the&nbsp;method&nbsp;will&nbsp;return&nbsp;an<br>
empty&nbsp;dictionary.</tt></dd></dl>

<dl><dt><a name="SMTP_TLS-set_debuglevel"><strong>set_debuglevel</strong></a>(self, debuglevel)</dt><dd><tt>Set&nbsp;the&nbsp;debug&nbsp;output&nbsp;level.<br>
&nbsp;<br>
A&nbsp;non-false&nbsp;value&nbsp;results&nbsp;in&nbsp;debug&nbsp;messages&nbsp;for&nbsp;connection&nbsp;and&nbsp;for&nbsp;all<br>
messages&nbsp;sent&nbsp;to&nbsp;and&nbsp;received&nbsp;from&nbsp;the&nbsp;server.</tt></dd></dl>

<dl><dt><a name="SMTP_TLS-verify"><strong>verify</strong></a>(self, address)</dt><dd><tt><a href="smtplib.html#SMTP">SMTP</a>&nbsp;'verify'&nbsp;command&nbsp;--&nbsp;checks&nbsp;for&nbsp;address&nbsp;validity.</tt></dd></dl>

<dl><dt><a name="SMTP_TLS-vrfy"><strong>vrfy</strong></a> = verify(self, address)</dt><dd><tt><a href="smtplib.html#SMTP">SMTP</a>&nbsp;'verify'&nbsp;command&nbsp;--&nbsp;checks&nbsp;for&nbsp;address&nbsp;validity.</tt></dd></dl>

<hr>
Data and other attributes inherited from <a href="smtplib.html#SMTP">smtplib.SMTP</a>:<br>
<dl><dt><strong>debuglevel</strong> = 0</dl>

<dl><dt><strong>default_port</strong> = 25</dl>

<dl><dt><strong>does_esmtp</strong> = 0</dl>

<dl><dt><strong>ehlo_msg</strong> = 'ehlo'</dl>

<dl><dt><strong>ehlo_resp</strong> = None</dl>

<dl><dt><strong>file</strong> = None</dl>

<dl><dt><strong>helo_resp</strong> = None</dl>

</td></tr></table></td></tr></table>
</body></html>